package com.sunlands.qdcy.deskmate.constant;

@SuppressWarnings("all")
public enum CommonResultMessage {

    SUCCESS(0L, "ok"),
    FAIL(-1L, "未知错误"),
    PARMAS_INVALID(11002L,"Parameter is invalid."),
    BING_FAILD(12000L,"user friends bind faild ! please try agin"),
    UNBING_FAILD(12001L,"user friends unbind faild ! please try agin"),
    UN_APPLY_BING(12002L,"未申请绑定道友，绑定失败"),
    NO_AUTH(10401L, "没有权限访问"),
    FOLLOW_FAILD(12003L,"关注失败"),
    UN_FOLLOW_FAILD(12004L,"取消关注失败"),
    MORE_OPERATION(12005L,"频繁操作"),
    APPLY_BING_FAIL_SELF(12006L,"自己不能申请绑定自己"),
    FOLLOW_FAIL_SELF(12007L,"自己不能关注自己"),
    USER_INVALID(12008L,"用户不存在"),
    UPLOAD_IMG_ERROR(12009L,"上传图片错误"),
    LIKE_AGAIN(12010L,"重复点赞"),
    DIARY_NOT_EXIST(12011L,"日记不存在"),
    WORD_SENSITIVE(12012L,"存在敏感词"),
    REPLAY_NOT_EXIST(12014L,"错误数据，回复不存在"),
    LIKE_NOT_EXIST(12015L,"点赞不存在"),
    USER_NOT_LOGIN(12016L,"用户未登录"),
    DELETE_NOT_EXIST(13000L,"删除数据不存在"),
    CON_SPECIAL(13001L, "包含特殊字符"),
    CON_SENSITIVE(13002L, "包含敏感词"),
    IMAGE_VIOLATION(14001L, "日记内容可能包含违规内容，请更正后再发表"),
    REPEAT_ORDER(30000L, "订单重复发货"),
    ;

    public final Long code;
    public final String message;

    CommonResultMessage(Long code, String message) {
        this.code = code;
        this.message = message;
    }

    public static CommonResultMessage getResult(Long code) {
        for (CommonResultMessage resultMessage : CommonResultMessage.values()) {
            if (resultMessage.code.equals(code)) {
                return resultMessage;
            }
        }
        return null;
    }

    public Long getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }
}
